package com.shuorikeji.huohuo.view;

import android.view.View;

import androidx.viewpager2.widget.ViewPager2;

public abstract class BasePageTransformer implements ViewPager2.PageTransformer{
    // 重置所有视图属性
    protected void resetTransform(View view) {
        view.setAlpha(1f);
        view.setTranslationX(0f);
        view.setTranslationY(0f);
        view.setTranslationZ(0f);
        view.setScaleX(1f);
        view.setScaleY(1f);
        view.setRotation(0f);
        view.setRotationX(0f);
        view.setRotationY(0f);
        view.setPivotX(view.getWidth() / 2f);
        view.setPivotY(view.getHeight() / 2f);
    }

    @Override
    public abstract void transformPage(View page, float position);
}
